<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/jsp/struts/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="style/home.css" type="text/css">
<script language=javascript src="script/prototype.js"></script>
<script language=javascript src="script/common.js"></script>
<script type="text/javascript">
function hidediv(id) {
    //safe function to hide an element with a specified id
    if (document.getElementById) { // DOM3 = IE5, NS6
        document.getElementById(id).style.display = 'none';
    }
    else {
        if (document.layers) { // Netscape 4
            document.id.display = 'none';
        }
        else { // IE 4
            document.all.id.style.display = 'none';
        }
    }
}

function showdiv(id) {
    //safe function to show an element with a specified id
          
    if (document.getElementById) { // DOM3 = IE5, NS6
        document.getElementById(id).style.display = 'block';
    }
    else {
        if (document.layers) { // Netscape 4
            document.id.display = 'block';
        }
        else { // IE 4
            document.all.id.style.display = 'block';
        }
    }
}

</script>
<STYLE TYPE="text/css">
#showCmd  {
    margin-top: 0.8em;
    margin-right: 1.2em;
    float:right
}
#hideCmd  {
    display:none;
    margin-top: 0.8em;
    margin-right: 1.2em;
    float:right
}
#logoDiv {
     margin-top: 0.8em;
     margin-left: 1.2em;
}
#searchDiv {
    display:none;
    clear:both;
}
#searchTab {
    margin-top: 0.8em;
    margin-right: 1.2em;
    background-color:#dddddd;
}
#searchTab td {
    padding:0.2em;
    border: 1px solid #606060;
}
.smallTitle {
    color::#ff99ff;
    text-align:right;
}
#bookList {
	border: 2px groove #eee;
}
#bookList a{
    font-size:1em;
    color:#330099
}
#bookList th,td{
    padding:0.2em 0.2em;
}
</STYLE>
<script language="Javascript">
function submitForm(method) {
	location.href="book.fym?method=" + method;
}
</script>
</head>
<body>
<div id="content">
<div id="content_inner">
<div id="logoDiv">
<a href="book.fym"><img src="images/books.gif" border="0"/></a>
</div>
<display:table htmlId="bookList" name="bookList" sort="list"  pagesize="40"
     class="its" id="book" requestURI="book.fym">
<display:setProperty name="paging.banner.placement" value="bottom" /> 
<display:setProperty name="basic.empty.showtable" value="true" />
<display:setProperty name="basic.msg.empty_list_row" value="<tr class='empty'><td colspan='{0}'>没有记录</td></tr>"/>
<display:column title="书名" sortable="true" headerClass="sortable" style="width:20em">
<img src="images/bullet.gif"/>
<INPUT TYPE="hidden" NAME="bookID" ID="bookID" value="${book.bookID}" >
<a href="book.fym?method=edit&bookID=${book.bookID}"
 title="${fn:escapeXml(book.bookName)}">
${book.bookName}
</a>
</display:column>
<display:column property="bookSN" title="书号" sortable="true" headerClass="sortable"/>
<display:column property="tags" title="标签"/>
<display:column title="状态" sortable="true" headerClass="sortable" style="white-space: nowrap">
<c:choose>
<c:when test="${book.borrowLogID eq 0}">
未借出
</c:when>
<c:otherwise>   
    <c:choose>
	<c:when test="${empty book.returnDate}">
	已借出
	</c:when>
	<c:otherwise>
	未借出
	</c:otherwise>
	</c:choose>
    
</c:otherwise>
</c:choose>
</display:column>
<display:column title="创建时间" sortable="true" headerClass="sortable" style="width:10em">
<fmt:formatDate value="${book.createTime}" pattern="MM/dd/yy HH:mm:ss"/>
</display:column>
<display:column title="<input type='button' onclick=\"submitForm('add')\" 
    value=' 增加  '/>" style="white-space:nowrap;padding:0.5em,0">
<a href="book.fym?method=edit&bookID=${book.bookID}&bookType=${param.bookType}" class="icon_btn pic_edit" title="Edit Task"><span>Edit Item</span></a>
<a href="book.fym?method=delete&bookID=${book.bookID}&bookType=${param.bookType}" class="icon_btn pic_delete" title="Delete Task"><span>Delete Item</span></a>
</display:column>
</display:table>
<!-- 
<input type="text" name="pageNum" value="${pageNum}" size="3">/${pageCount}
<input type="button" value="Go" onclick="location.href='book.fym?pageNum=0'"/> 
-->
<div id="showCmd">
<img src="images/Join.gif"/>
<a href="#" onclick="showdiv('hideCmd');showdiv('searchDiv');hidediv('showCmd')">想要查询</a>
</div>
<div id="hideCmd">
<img src="images/Join.gif"/>
<a href="#" onclick="hidediv('hideCmd');hidediv('searchDiv');showdiv('showCmd')">不想查询</a>
</div>
<div id="searchDiv">
<form name="bookForm" id="bookForm" action="book.fym?method=find"  method="post">
<TABLE id="searchTab">
<tr>
<td class="smallTitle" width="20%">书名: </td>
<td><INPUT TYPE="text" NAME="bookName" size="36"></td>
</tr>
<tr>
<td class="smallTitle">书号: </td>
<td><INPUT TYPE="text" NAME="bookSN" size="36"></td>
</tr>
<tr>
<td class="smallTitle">标签: </td>
<td><INPUT TYPE="text" NAME="tags" size="36"></td>
</tr>
<tr>
<td class="smallTitle">状态:</td>
<td><SELECT NAME="status">
    <OPTION VALUE="0" SELECTED>-选择-</OPTION>
    <OPTION VALUE="1">未借出</OPTION>
    <OPTION VALUE="2">已借出</OPTION>
  </SELECT>
  </td>
</tr>
<tr>
<td class="smallTitle">借阅者: </td>
<td><INPUT TYPE="text" NAME="borrower" size="36"></td>
</tr>
<tr>
<td class="smallTitle">借阅天数&gt; </td>
<td><INPUT TYPE="text" NAME="days"></td>
</tr>
<TR>
<TD colspan="2" align="center">
<INPUT TYPE="submit" value=" 查询 ">
</TD>
</TR>
</TABLE>
</form>
</div>

</div></div>
</body>
</html>